const http=require('http');
const hostname="127.0.0.1";
const port=8003;

http.createServer(function (req,res) {
  // let msg={name:'wxs'};
  // res.write(JSON.stringify(msg));
  res.writeHead(200,{"content-type":"text/html;charset=utf-8"})
  res.write("<h1>这是响应的内容</h1>");
  res.end();
}).listen(port,hostname,()=>{
  console.log(`服务器启动成功,可以通过 http://${hostname}:${port} 来访问`);
})



